let username = null;

function setusername(name) {
    console.log('已经登陆：' + name);
    username = name;           // name
}